package com.aaa.demo12;

import javax.smartcardio.CommandAPDU;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * @author ${崔灿}
 * @date 2022/11/04 09:47
 **/

public class Test02 {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(55);
        list.add(7);
        list.add(5);
        list.add(6);
        //Comparator<Integer> comparator =(o1,o2)->Integer.compare(o1,o2);
        Comparator <Integer> comparator = Integer::compare;
        Collections.sort(list,comparator);
        System.out.println(list);
    }
}
